package com.javabasic.oop;

public class Unit30TryCatch {
	public static void main(String[] args) {
		String test = "Hello World";

		System.out.println("Before");

		try {
			// 50 --> Error
			// System.out.println(test.substring(50));

			System.out.println(test.substring(10));
			int a = 5;
			int b = 0;
			System.out.println("a/b = " + a / b);
		} catch (StringIndexOutOfBoundsException e) {
			System.out.println("Error: " + e);
		} catch (ArithmeticException e) {
			System.out.println("Error ArithmeticException: " + e);
		} catch (Exception e) {
			System.out.println("Error all: " + e);
		} finally {
			System.out.println("Alway done");
		}

		System.out.println("After");
	}
}
